﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.MonthCalendar;

namespace sy2_5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string input = textBox1.Text;
            string week;
            // switch判断输入的字符串（注意case是字符串"1"而非数字1）
            switch (input)
            {
                case "1":
                    week = "Monday";
                    break;
                case "2":
                    week = "Tuesday";
                    break;
                case "3":
                    week = "Wednesday";
                    break;
                case "4":
                    week = "Thursday";
                    break;
                case "5":
                    week = "Friday";
                    break;
                case "6":
                    week = "Saturday";
                    break;
                case "7":
                    week = "Sunday";
                    break;
                default:
                    // 输入非法时弹出提示框
                    MessageBox.Show("请输入数字1-7!");
                    week = ""; // 清空结果
                    break;
            }
            textBox2.Text = week;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
        }
    }
    
}
